<fieldset id="submission_type_fields">
  <div class="form-column-left">
    <label for="assignment_submission_type">
      {{#t "submission_type"}}Submission Type{{/t}}
    </label>
  </div>
  <div class="form-column-right">
    <div class="border border-trbl border-round">

      {{!-- Submission type accepted --}}
      <select id="assignment_submission_type"
        name="submission_type"
        aria-controls="assignment_online_submission_types,assignment_external_tool_settings,assignment_group_selector,assignment_peer_reviews_fields"
        {{disabledIfIncludes frozenAttributes "submission_types"}}>
        <option value="none" {{selectedIf submissionType "none"}}>
          {{#t "submission_types.no_submission"}}No Submission{{/t}}
        </option>
        <option value="online" {{selectedIf submissionType "online"}}>
          {{#t "submission_types.online"}}Online{{/t}}
        </option>
        <option value="on_paper" {{selectedIf submissionType "on_paper"}}>
          {{#t "submission_types.on_paper"}}On Paper{{/t}}
        </option>
        <option value="external_tool" {{selectedIf submissionType "external_tool"}}>
          {{#t "submission_types.external_tool"}}External Tool{{/t}}
        </option>
      </select>

      {{!-- Online submission types --}}
      <div id="assignment_online_submission_types"
        aria-enabled="{{isOnlineSubmission}}"
        style="{{hiddenUnless isOnlineSubmission}}">

        <div class="subtitle">
          <strong>
            {{#t 'online_entry_options'}}Online Entry Options{{/t}}
          </strong>
        </div>

        <label class="checkbox" for="assignment_text_entry">
          {{checkbox "acceptsOnlineTextEntries"
            id="assignment_text_entry"
            name="online_submission_types[online_text_entry]"
            aria-label=(t "Online Submission Type - Text Entry")
            disabled=submissionTypesFrozen}}
          {{#t "labels.allow_text_entry"}}Text Entry{{/t}}
        </label>

        <label class="checkbox" for="assignment_online_url">
          {{checkbox "acceptsOnlineURL"
            id="assignment_online_url"
            name="online_submission_types[online_url]"
            aria-label=(t "Online Submission Type - Website URL")
            disabled=submissionTypesFrozen}}
          {{#t "labels.allow_url"}}Website URL{{/t}}
        </label>
        {{#if kalturaEnabled}}
          <label class="checkbox" for="assignment_media_recording">
            {{checkbox "acceptsMediaRecording"
              id="assignment_media_recording"
              name="online_submission_types[media_recording]"
              aria-label=(t "Online Submission Type - Media Recordings")
              disabled=submissionTypesFrozen}}
            {{#t "labels.allow_media_recordings"}}Media Recordings{{/t}}
          </label>
        {{/if}}
        <label class="checkbox" for="assignment_online_upload">
          {{checkbox "acceptsOnlineUpload"
            id="assignment_online_upload"
            name="online_submission_types[online_upload]"
            aria-controls="restrict_file_extensions_container"
            aria-label=(t "Online Submission Type - File Uploads")
            disabled=submissionTypesFrozen}}
          {{#t "labels.allow_file_uploads"}}File Uploads{{/t}}
        </label>

        {{!-- Online submission restrict file types? --}}
        <div id="restrict_file_extensions_container"
          class="nested"
          aria-expanded="{{acceptsOnlineUpload}}"
          style="{{hiddenUnless acceptsOnlineUpload}}">

          <label class="checkbox" for="assignment_restrict_file_extensions">
            {{checkbox "restrictFileExtensions"
              id="assignment_restrict_file_extensions"
              name="restrict_file_extensions"
              aria-controls="allowed_extensions_container"
              aria-label=(t "Online Submission Type - File Uploads - Restrict Upload File Types")
              disabled=submissionTypesFrozen}}
            {{#t "labels.restrict_file_extensions"}}
              Restrict Upload File Types
            {{/t}}
          </label>

          {{!-- Online submission allowed extensions --}}
          <div id="allowed_extensions_container"
            aria-expanded="{{restrictFileExtensions}}"
            style="{{hiddenUnless restrictFileExtensions}}"
            class="nested">
            <label for="assignment_allowed_extensions" class="hidden-readable">
              {{#t "labels.allowed_extensions"}}Allowed File Extensions{{/t}}
            </label>

            <input id="assignment_allowed_extensions"
              name="allowed_extensions"
              type="text"
              maxlength="254"
              placeholder="{{#t "labels.allowed_extensions"}}Allowed File Extensions{{/t}}"
              aria-labelledby="explanation_nest"
              value="{{join allowedExtensions ","}}"
              {{disabledIfIncludes frozenAttributes "submission_types"}}/>
            <div id="explanation_nest" class="explanation nest">
              {{#t "descriptions.allowed_extensions"}}
                Enter a list of accepted extensions, for example: doc,xls,txt
              {{/t}}
            </div>
          </div>
        </div>

        {{!-- Turnitin (online assignments only) --}}
        <div style="{{hiddenUnless turnitinAvailable}}">
          <label for="assignment_turnitin_enabled" class="checkbox">
            {{checkbox "turnitinEnabled"
              id="assignment_turnitin_enabled"
              name="turnitin_enabled"
              aria-controls="advanced_turnitin_settings_link"
              disabled=submissionTypesFrozen}}
            {{#t "label.turnitin_enabled"}}Enable Turnitin Submissions{{/t}}
          </label>

          <div class="nested">
            <a href="#"
              id="advanced_turnitin_settings_link"
              aria-expanded="{{turnitinEnabled}}"
              style="{{hiddenUnless turnitinEnabled}}">
              {{#t "advanced_turnitin_settings"}}Advanced Turnitin Settings{{/t}}
            </a>
          </div>
        </div>
        {{!-- VeriCite (online assignments only) --}}
        <div style="{{hiddenUnless vericiteAvailable}}">
          <label for="assignment_vericite_enabled" class="checkbox">
            {{checkbox "vericiteEnabled"
              id="assignment_vericite_enabled"
              name="vericite_enabled"
              aria-controls="advanced_turnitin_settings_link"
              disabled=submissionTypesFrozen}}
            {{#t "label.vericite_enabled"}}Enable VeriCite Submissions{{/t}}
          </label>
          <div class="nested">
            <a href="#"
              id="advanced_turnitin_settings_link"
              aria-expanded="{{vericiteEnabled}}"
              style="{{hiddenUnless vericiteEnabled}}">
              {{#t "advanced_vericite_settings"}}Advanced VeriCite Settings{{/t}}
            </a>
          </div>
        </div>
      </div>

      {{!-- External tool submissions --}}
      <div id="assignment_external_tool_settings" style="{{hiddenUnless isExternalTool}}">
        <div class="subtitle">
          <strong>
            {{#t 'external_tool_options'}}External Tool Options{{/t}}
          </strong>
        </div>
        <div class="pad-box-mini">
          <div class="ic-Form-control">
            <label class="ic-Label" for="assignment_external_tool_tag_attributes_url">
              {{#t}}Enter or find an External Tool URL{{/t}}
            </label>
            <div class="ic-Input-group">
              <div class="ic-Input-group__add-on" aria-hidden="true">
                {{> icons/link}}
              </div>
              <input id="assignment_external_tool_tag_attributes_url"
                class="ic-Input"
                name="external_tool_tag_attributes[url]"
                type="url"
                value="{{externalToolUrl}}"
                placeholder="http://www.example.com/launch"
                {{disabledIfIncludes frozenAttributes "submission_types"}}/>
              <button class="Button" id="assignment_external_tool_tag_attributes_url_find" type="button">
                {{#t}}Find{{/t}}
              </button>
            </div>
          </div>
          <input id="assignment_external_tool_tag_attributes_content_type"
                 name="external_tool_tag_attributes[content_type]"
                 type="text"
                 style="display: none"/>
          <input id="assignment_external_tool_tag_attributes_content_id"
                 name="external_tool_tag_attributes[content_id]"
                 type="text"
                 style="display: none"/>
        </div>

        {{#unless isQuizLTIAssignment}}
          <label for="assignment_external_tool_tag_attributes_new_tab" class="checkbox">
            {{checkbox "externalToolNewTab"
              id="assignment_external_tool_tag_attributes_new_tab"
              name="external_tool_tag_attributes[new_tab]"
              disabled=submissionTypesFrozen}}
            {{#t "label.external_tool_new_tab"}}Load This Tool In A New Tab{{/t}}
          </label>
        {{/unless}}

        {{#if groupCategoryId}}
          <div class="alert assignment-edit-external-tool-alert">
            {{#t "external_tool_group_warning"}}
              Group assignments can't use External Tools.
              The group setting will be unchecked when you save
            {{/t}}
          </div>
        {{/if}}
      </div>
    </div>
  </div>
</fieldset>
